<template>
  <div class="topbar">
    <div class="content flex_btw">
      <span>我的日志</span>
      <span @click="_logout" class="icon"><i class="iconfont icon-zhuxiao"></i></span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TopBar',
  methods:{
    _logout(){
      // 清空数据
      this.$store.commit('searchArticle','')
      this.$store.commit('setSelectedId','')
      this.$router.replace('/login')
    }
  }
}
</script>

<style scoped lang="less">
.topbar{
  height: 40px;
  background: #4CB98A;
  width: 100%;
  .content{
    color: white;
    height: 40px;
    width: 68%;
    margin: 0 auto;
    .icon{
      font-size: 1.4em;
      cursor: pointer;
    }
  }
}
</style>
